﻿using ShowScreenProject.ChildFrm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ShowScreenProject
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private int index = 0;

        private double frmTop = 0.0;
        private double frmLeft = 0.0;
        public MainWindow()
        {
            InitializeComponent();
        }

        private void StartShowScreen(object sender, RoutedEventArgs e)
        {
            ShowSomeInfoFrm frm = new ShowSomeInfoFrm();
            
            ScreenHelper.ComputeFormCount(frm.Height, frm.Width);

            //MessageBox.Show(string.Format("当前屏幕高度:{0},当前屏幕宽度{1},横向可展示{2}个,纵向可展示{3}个"
            //    , ScreenHelper.ScreenHeight,
            //   ScreenHelper.ScreenWidth,
            //    ScreenHelper.HorizontalCount,
            //    ScreenHelper.LongitudinalCount
            //    ));
            //ShowSomeInfoFrm frm=new ShowSomeInfoFrm();

            WindowsFormLocation location= ScreenHelper.ComputeFromLocation(index, frm.Height, frm.Width);
            frm.Top = location.Top;
            frm.Left = location.Left;
            frm.Show();

            index++;

        }

        private void ResetEvent(object sender, RoutedEventArgs e)
        {

            this.index = 1;
        }

    }
}
